1 using System.Collections;
2 using
System.Collections.Generic;
3 using
UnityEngine;
4
5 public
class GameBoundary : MonoBehaviour {
6
7     
// Use this for initialization
8     
void Start () {
9         
10     }
11     
12     
// Update is called once per frame
13     
void Update () {
14         
15     }
16
17     
void OnTriggerEnter2D(Collider2D collider){
18         
if(collider.CompareTag("Player Bullet") || collider.CompareTag("Enemy") || collider.CompareTag("Coin") || collider.CompareTag("Boss Bullet")){
19             Destroy (collider.gameObject);
20         }
21             
22     }
23 }


Use this for initialization

Update is called once per frame



Gõ tìm kiếm nhanh...